# Quasi-specular diffuse scattering parameters
#
# This optional term adds an asymmetric diffuse/incoherent contribution
# to the simulated 2theta-omega specular scan.
#
# It is intended for highly implanted / defective samples where the
# coherent strain + Debye-Waller model underestimates a one-sided tail
# close to the relaxed Bragg peak.
#
# The implemented model is:
#
# I_final(theta) = I_coherent(theta) + I_diffuse(theta)
#
# I_diffuse(theta) = A_diff * S_diff * T(theta)
#
# where:
#
# S_diff = integral [ (1 - DW(z)) * |d epsilon_c / dz| dz ]
#
# This source term increases when the layer contains both:
#   - local disorder, measured approximately by 1-DW(z)
#   - strain heterogeneity, measured by |d epsilon_c/dz|
#
# The angular tail is a one-sided Lorentz-like function:
#
# T(theta) = 1 / (1 + ((theta - theta0)/gamma_diff)^2)
#
# applied only on one side of theta0.
#
# theta0_side:
#   Side where the diffuse tail is added.
#   Use:
#       -1  for low-angle side  theta < theta0
#        1  for high-angle side theta > theta0
#
# A_diff:
#   Dimensionless amplitude scale of the diffuse contribution.
#   Start very small.
#   Suggested range: 1e-5 - 1e-2
#
# gamma_diff_deg:
#   Angular width of the diffuse tail, in degrees of 2theta.
#   Small values produce a narrow tail.
#   Large values produce a long/open tail.
#   Suggested range: 0.002 - 0.05 deg.
#
# use_gradient:
#   If 1, source term uses (1-DW)*|d epsilon/dz|.
#   If 0, source term uses only (1-DW).
#
# Format:
# parameter_name = value

theta0_side    = 1
A_diff         = 0.2
gamma_diff_deg = 0.2
use_gradient   = 0